﻿@model ConfigDashboard.Models.SpreadsheetImportResult

@{
    ViewBag.Title = "Import";
}

<h2>Import Settings</h2>

@Html.ActionLink("« Back to Administration Home", "Index")

<p>
Import settings from a comma separated value (CSV) file. Environment names should be in the first row, and setting names
 should be in the first column.
</p>

@using (Html.BeginForm("Upload", "Admin", null, FormMethod.Post, new { enctype = "multipart/form-data" } )) {
      
         <label for="FileToUpload">CSV File To Upload:</label>
         <br />
         <input type="file" name="FileToUpload" style="width: 450px;"/>

         <button type="submit" name="Submit" id="Submit">Upload</button>
}

@if (null != Model) {
    <div>Environments Imported Successfully: @Model.EnvironmentsImportedSuccessfully</div>
    <div>Setting Names Imported Successfully: @Model.SettingNamesImportedSuccessfully</div>
    <div>Settings Imported Successfully: @Model.SettingsImportedSuccessfully</div>
    if (Model.Messages.Count > 0)
    {
    <div>
    <ol>
        @foreach (var message in Model.Messages)
        {
            <li>@message.Message</li>
        }
    </ol>
    </div>
    }
}


